package com.itcrm.baiduai.net;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

/**
 * <h3>Description:  </h3>
 * <b>Notes:</b> Created by KevinMeng on 2017/12/19.<br />
 */

public class NetUtils {

    /**
     * 获取权限token
     * @return 返回示例：
     * {
     * "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
     * "expires_in": 2592000
     * }
     */
//    public static String getAuth() throws IOException {
//        OkHttpClient client = new OkHttpClient();
//        final Request request = new Request.Builder().url(Api.GET_AUTH_PREFIX +
//                "grant_type=client_credentials" + "&client_id=" + Api.APP_KEY +
//                "&client_secret=" + Api.SECRET_KEY)
//                .build();
//        Response response = null;
//        client.newCall(request).enqueue(new Callback() {
//            @Override
//            public void onFailure(Call call, IOException e) {
//
//            }
//
//            @Override
//            public void onResponse(Call call, Response response) throws IOException {
//                response = response;
//            }
//        });
//    }
}